---
title: Manage case cost entries
summary: Create, validate, update, and delete billing/cost line items associated with a legal case.
status: draft
owner: SAIF Case Management team
last_reviewed: 2026-08-21
library: SAIF.Business.Claim.Legal
reference_type: embedded
operation_id: OP-CLL-002
trigger: User adds or edits a cost line on a legal case
---

# Manage case cost entries

Create, validate, update, and delete billing/cost line items associated with a legal case.

| Field | Value |
|---|---|
| **Operation ID** | OP-CLL-002 |
| **Trigger** | User adds or edits a cost line on a legal case |
| **Inputs** | Business-object criteria properties set by the caller (see linked SQL parameter tables) |
| **Outputs** | Persisted/retrieved `clsCaseCost` state |
| **Primary components** | `clsCaseCost, clsCaseCostCollection` |
| **Entry point** | `SAIF.Business.Claim.Legal\LegalNet\clsCaseCost.vb` |

## Steps

1. Validate the request against applicable business rules: [BR-CLM-LGL-001](../business-rules.md#br-clm-lgl-001-case-cost-date-ranges-must-be-valid), [BR-CLM-LGL-002](../business-rules.md#br-clm-lgl-002-case-cost-entry-requires-a-payee), [BR-CLM-LGL-003](../business-rules.md#br-clm-lgl-003-case-cost-entry-requires-service-code%2C-authorizer%2C-and-canceller), [BR-CLM-LGL-005](../business-rules.md#br-clm-lgl-005-non-single-row-crud-result-is-treated-as-a-failure)
   - On failure: validation errors are collected and returned to the caller; the operation does not proceed.
2. Execute the underlying data access for `clsCaseCost` against: [DB-CLL-001](../sql/SQL-001-casecost.md), [DB-CLL-002](../sql/SQL-002-casecost.md), [DB-CLL-003](../sql/SQL-003-casecost.md), [DB-CLL-004](../sql/SQL-004-casecost.md), [DB-CLL-006](../sql/SQL-006-casecostcollection.md)
   - Tables affected: [CASE_COST](../database-tables.md#case_cost)
3. Return the resulting object graph (or success/failure status) to the caller.

## Process flow

```mermaid
flowchart TD
	Start([User adds or edits a cost line on a legal case]) --> Validate[Validate business rules]
	Validate --> Decision{Valid?}
	Decision -->|No| EndErr([Return validation errors])
	Decision -->|Yes| Exec[Execute data access for clsCaseCost]
	Exec --> EndOk([Return result])
```

## Failure and edge-case behavior

- Validation failure: the operation returns collected errors without persisting any change.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Business.Claim.Legal\` (clsCaseCost, clsCaseCostCollection)